from pyecharts.charts import Scatter
from pyecharts import options as opts
x_data = [10, 20, 30, 40, 50]
y_data = [20, 40, 60, 80, 100]
z_data = [1, 4, 9, 16, 25]
scatter = Scatter()
scatter.add_xaxis(x_data)
scatter.add_yaxis("", [list(z) for z in zip(y_data, z_data)])
scatter.set_global_opts(
    title_opts=opts.TitleOpts(title="气泡图示例"),
    xaxis_opts=opts.AxisOpts(name="X轴"),
    yaxis_opts=opts.AxisOpts(name="Y轴"),
    visualmap_opts=opts.VisualMapOpts(
        type_="size",
        min_=0,
        max_=25,
    ),
)
scatter.render("气泡图.html")